package com.jxpanda.spring.module.wechat.component.http.base.constant;

import com.jxpanda.spring.module.wechat.component.http.base.WechatApi;
import com.jxpanda.spring.module.wechat.component.http.base.request.query.MiniProgramQuery;
import com.jxpanda.spring.module.wechat.component.http.base.response.MiniProgramResponse;
import lombok.Getter;

/**
 * 小程序接口地址
 *
 * @author Panda
 */
public final class MiniProgramApi {

    /**
     * 小程序-获取接口调用凭证
     * 文档地址：<a href="https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/mp-access-token/getAccessToken.html">小程序-获取接口调用凭证</a>
     */
    public static final WechatApi<MiniProgramQuery.AccessToken, Void, MiniProgramResponse.AccessToken> GET_ACCESS_TOKEN = new WechatApi<>() {

        @Getter
        private final String url = "https://api.weixin.qq.com/cgi-bin/token";

    };

    /**
     * 小程序-登录
     * 文档地址：<a href="https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/login/auth.code2Session.html">小程序-登录</a>
     */
    public static final WechatApi<MiniProgramQuery.JsCode2Session, Void, MiniProgramResponse.JsCode2Session> JS_CODE_2_SESSION = new WechatApi<>() {

        @Getter
        private final String url = "https://api.weixin.qq.com/sns/jscode2session";
    };

}
